<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class MySQLTableReport</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class MySQLTableReport</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">class MySQLTableReport  Generic reporting class.  Given a configuration file, that describes the tables  and fields to be searched, and information to connect to a database, take form data  and generate an SQL query to run.</p>
<p class="description"><p>The report object is made to address a certain class of reports:  Time series data,  to aggregate by some arbitrary column and return the SUM/MIN/MAX/AVG/etc of other  columns.</p><p>Basic usage:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$report&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../default/MySQLTableReport.html">MySQLTableReport</a></span><span class="src-sym">(&nbsp;</span><span class="src-var">$datasource</span><span class="src-sym">,&nbsp;</span><span class="src-var">$tables</span><span class="src-sym">,&nbsp;</span><span class="src-var">$report</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;run&nbsp;the&nbsp;query&nbsp;and&nbsp;get&nbsp;the&nbsp;result&nbsp;and&nbsp;header&nbsp;data</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$result&nbsp;&nbsp;</span>=&nbsp;<span class="src-var">$report</span><span class="src-sym">-&gt;</span><a href="../default/MySQLTableReport.html#methodexecute">execute</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$columns&nbsp;</span>=&nbsp;<span class="src-var">$report</span><span class="src-sym">-&gt;</span><a href="../default/MySQLTableReport.html#methodget_column_names">get_column_names</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;...&nbsp;display&nbsp;as&nbsp;desired.</span></div></li>
</ol></div></p><p>the parameters above have the following forms:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$datasource&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'host'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-var">$host</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;the&nbsp;mysql&nbsp;server&nbsp;hostname</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'port'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-var">$port</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;optional&nbsp;port&nbsp;number</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'user'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-var">$user</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;the&nbsp;user&nbsp;credential</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'password'&nbsp;</span>=&gt;&nbsp;<span class="src-var">$pass</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;the&nbsp;password&nbsp;for&nbsp;the&nbsp;user</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'db'&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-var">$db</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;the&nbsp;database&nbsp;name</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$tables&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'fact_table_name'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'fact'</span><span class="src-sym">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//&nbsp;table_name&nbsp;=&gt;&nbsp;alias</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'dimension_table_name'&nbsp;&nbsp;</span>=&gt;&nbsp;&nbsp;<span class="src-str">'dimension'</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;table_name&nbsp;=&gt;&nbsp;alias</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p>The aliases used for tables are mostly anything you choose *except* that one  table must have the alias 'fact'.  This is considered the root table to which  any additional tables can be joined. There can be only one fact table, but you can  have any number of dimension tables as long as each have unique aliases</p><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$report&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;JOIN&nbsp;clause&nbsp;for&nbsp;any&nbsp;dimension&nbsp;tables.&nbsp;&nbsp;Specify&nbsp;the&nbsp;exact&nbsp;clause&nbsp;used</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;for&nbsp;each&nbsp;table&nbsp;alias</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'join'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'dimension'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;&nbsp;<span class="src-str">&quot;USING&nbsp;(id)&quot;</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;fields&nbsp;for&nbsp;the&nbsp;tables;&nbsp;defined&nbsp;by&nbsp;the&nbsp;table's&nbsp;alias&nbsp;and&nbsp;not&nbsp;the&nbsp;real&nbsp;table&nbsp;name</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;allows&nbsp;the&nbsp;exact&nbsp;same&nbsp;report&nbsp;to&nbsp;be&nbsp;used&nbsp;on&nbsp;tables&nbsp;with&nbsp;the&nbsp;same&nbsp;structure</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;but&nbsp;different&nbsp;names</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'fields'&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'fact'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'name'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'clear|where'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note&nbsp;that&nbsp;these&nbsp;aren't&nbsp;field&nbsp;names&nbsp;in&nbsp;the&nbsp;table,&nbsp;but&nbsp;we&nbsp;need</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;a&nbsp;place&nbsp;to&nbsp;put&nbsp;them&nbsp;for&nbsp;the&nbsp;form&nbsp;processor&nbsp;to&nbsp;handle&nbsp;them</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;filters&nbsp;here&nbsp;will&nbsp;make&nbsp;sure&nbsp;the&nbsp;data&nbsp;gets&nbsp;added&nbsp;to&nbsp;the&nbsp;right</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;part&nbsp;of&nbsp;the&nbsp;query,&nbsp;and&nbsp;not&nbsp;the&nbsp;WHERE&nbsp;clause&nbsp;like&nbsp;other&nbsp;fields.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'group'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'group'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'order'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'order'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'having'&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'having'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'limit'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'limit'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'dimension'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'date'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'date_range|clear|where'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'price'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'ge|clear|where'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//&nbsp;end&nbsp;fields</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;custom&nbsp;fields&nbsp;are&nbsp;allowed&nbsp;as&nbsp;well</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'custom_fields'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'epoch'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;&nbsp;<span class="src-str">'FROM_UNIXTIME(date)'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'snippet'&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;&nbsp;<span class="src-str">'LEFT(info,15)'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Gavin Towey &lt;<a href="mailto:gavin@box.com">gavin@box.com</a>&gt;</li>
				<li><span class="field">todo:</span> describe the config format in more detail</li>
				<li><span class="field">todo:</span> create a base class</li>
				<li><span class="field">todo:</span> abstract aggregate function handling (or move to the config)</li>
				<li><span class="field">todo:</span> create a pear package out of this</li>
				<li><span class="field">license:</span> contact</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_MySQLTableReport.php.html">/MySQLTableReport.php</a> (line <span class="field">96</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																																																																																																																																																												
												<div class="method-definition">
											<span class="method-result">MySQLTableReport</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$datasource</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$tables</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$report</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#clear" title="details" class="method-name">clear</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$op</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#date_range" title="details" class="method-name">date_range</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#execute" title="details" class="method-name">execute</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#from" title="details" class="method-name">from</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$table</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#ge" title="details" class="method-name">ge</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">srray</span>
										<a href="#get_column_names" title="details" class="method-name">get_column_names</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_custom_fields" title="details" class="method-name">get_custom_fields</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_distinct_values" title="details" class="method-name">get_distinct_values</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$colname</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_form_fields" title="details" class="method-name">get_form_fields</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_form_field_values" title="details" class="method-name">get_form_field_values</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_pivot_values" title="details" class="method-name">get_pivot_values</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#get_search_uri" title="details" class="method-name">get_search_uri</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_tables" title="details" class="method-name">get_tables</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#get_table_by_alias" title="details" class="method-name">get_table_by_alias</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$alias</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_table_fields" title="details" class="method-name">get_table_fields</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$table_name</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#group" title="details" class="method-name">group</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#gt" title="details" class="method-name">gt</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#having" title="details" class="method-name">having</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$key</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#join" title="details" class="method-name">join</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$table</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#le" title="details" class="method-name">le</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#like" title="details" class="method-name">like</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#limit" title="details" class="method-name">limit</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$key</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#lt" title="details" class="method-name">lt</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#ne" title="details" class="method-name">ne</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#order" title="details" class="method-name">order</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$key</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport|string</span>
										<a href="#pivot" title="details" class="method-name">pivot</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#process_form_data" title="details" class="method-name">process_form_data</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#query" title="details" class="method-name">query</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#raw_where" title="details" class="method-name">raw_where</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#select" title="details" class="method-name">select</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$alias</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$aggregate</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#set_pivot_values" title="details" class="method-name">set_pivot_values</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$values</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">\MySQLTableReport</span>
										<a href="#where" title="details" class="method-name">where</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$op</span> = <span class="var-default">null</span>])
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">127</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">create a new instance, pass configuration information describing the datasource  and the report tables and fields.</p>
	
	<div class="method-signature">
		<span class="method-result">MySQLTableReport</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$datasource</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$tables</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$report</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$datasource</span><span class="var-description">: Database connection information required :host,user,password,db; optional: port</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$tables</span><span class="var-description">: Tables to use for this report.  format is array( 'table_name'   =&gt; 'alias' )  there must be at least one &quot;fact&quot; table, and optionally a &quot;dimension&quot; table</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$report</span><span class="var-description">: config array describing the table structure and other options</span>			</li>
				</ul>
		
			
	</div>
<a name="methodclear" id="clear"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">clear</span> (line <span class="line-number">567</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Remove blank strings as values in form fields.</p>
<p class="description"><p>Most cases, the forms you create can have empty fields which mean those  conditions should be omitted from the WHERE clause.  However, the form  will send and empty string.  When you want an empty field to be removed from  the WHERE clause, pass it through the clear filter first.</p><p>'fields' =&gt; array(       'dimension' =&gt; array(           'hostname'  =&gt;  'clear|where', // if hostname is blank, do not include it in the query.       )  )</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			clear
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$op</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the form field as a column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the form variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: the value of the field</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$op</span>			</li>
				</ul>
		
			
	</div>
<a name="methoddate_range" id="date_range"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">date_range</span> (line <span class="line-number">541</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">look for a range of date values for the given column, and return  values to be added to the WHERE clause</p>
<p class="description"><p>This is used when you have a column like &quot;invoice_date&quot; in the report,  but what you really want to search for is a range of dates bewteen a given  start and end date.</p><p>To do that, create form fields with _start and _end added to the name,  and pass the column to this processor.  It will search for the appropriate  form fields and build the range.</p><p>&lt;input type=&quot;text&quot; name=&quot;dimension-invoice_date_start&quot;&gt;  &lt;input type=&quot;text&quot; name=&quot;dimension-invoice_date_end&quot;&gt;</p><p>The config settings would look like:</p><p>'fields' =&gt; array(       'dimension' =&gt; array(           'invoice_date'  =&gt;  'date_range|clear|where',       )  )</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> the list of expressions to pass to the where function</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			date_range
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the base column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the base field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: ignored</span>			</li>
				</ul>
		
			
	</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">execute</span> (line <span class="line-number">888</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Execute the generated query on the configured databse and return  a result handle</p>
	<ul class="tags">
				<li><span class="field">return:</span> array that contains the result set</li>
				<li><span class="field">throws:</span> Exception if there is an error executing the query</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			execute
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span><span class="var-description">: optional sql to execute.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfrom" id="from"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">from</span> (line <span class="line-number">362</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">define the primary table to select from</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			from
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$table</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$table</span><span class="var-description">: The table to select from; the format is array(table_name, alias)</span>			</li>
				</ul>
		
			
	</div>
<a name="methodge" id="ge"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">ge</span> (line <span class="line-number">599</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">apply a &quot;greater than or equal to&quot; operator to a WHERE condition, instead  of the default equality matching</p>
<p class="description"><p>By default a configuration section like this would produce equality matching:</p><p>'fields' =&gt; array(       'dimension' =&gt; array(           'price'  =&gt;  'clear|where', // generates SQL such as: WHERE price = &lt;some value&gt;       )  )</p><p>If you need a range of values, include the appropriate operator as a filter:</p><p>'fields' =&gt; array(       'dimension' =&gt; array(           'price'  =&gt;  'clear|ge|where', // generates SQL such as: WHERE price &gt;= &lt;some value&gt;       )  )</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> condition to pass to next filter</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			ge
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The field value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodget_column_names" id="get_column_names"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_column_names</span> (line <span class="line-number">874</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">retuns a list of all column names.  These will be exactly the same as  the columns returned by the query.</p>
	<ul class="tags">
				<li><span class="field">return:</span> the list of column names</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">srray</span>
		<span class="method-name">
			get_column_names
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodget_custom_fields" id="get_custom_fields"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_custom_fields</span> (line <span class="line-number">269</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">returns a list of custom fields names.</p>
<p class="description"><p>Custom fields are additional columns that can be used in the SELECT clause,  but not as WHERE or other conditions.  They are defined in the configuration  used to create the object</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> the custom field list</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_custom_fields
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodget_distinct_values" id="get_distinct_values"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_distinct_values</span> (line <span class="line-number">320</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">given a table and column, find all the unique values.  This is a utility  method often used when building dropdown lists on a search form, or getting  values for pivot operations.</p>
	<ul class="tags">
				<li><span class="field">return:</span> the list of unique values</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_distinct_values
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$colname</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$table</span><span class="var-description">: the table name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$colname</span><span class="var-description">: the column name</span>			</li>
				</ul>
		
			
	</div>
<a name="methodget_form_fields" id="get_form_fields"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_form_fields</span> (line <span class="line-number">247</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return the list of form fields defined by the configuration parameters used   to construct this object.  Field names are prefixed by the table *alias*</p>
<p class="description"><p>so if the configuration section looked like :  'fields' =&gt; array(       'fact'  =&gt; array(           'checksum'  =&gt; '...',       ),       'dimension' =&gt; array(           'hostname'  =&gt; '...',       ),</p><p>The result would be an array with the values ('fact-checksum', 'dimension-hostname').</p><p>These are the form field names that will be checked to build the search parameters.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> the form fields</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_form_fields
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodget_form_field_values" id="get_form_field_values"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_form_field_values</span> (line <span class="line-number">335</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return an associate array with form_field_name =&gt; value for all fields.</p>
	<ul class="tags">
				<li><span class="field">return:</span> the array of field names and values</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_form_field_values
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodget_pivot_values" id="get_pivot_values"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_pivot_values</span> (line <span class="line-number">180</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return the list of values for a given pivot column</p>
	<ul class="tags">
				<li><span class="field">return:</span> the list of values defined by set_pivot_values</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_pivot_values
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the pivot column</span>			</li>
				</ul>
		
			
	</div>
<a name="methodget_search_uri" id="get_search_uri"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_search_uri</span> (line <span class="line-number">923</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return a urlencoded string of parameters that were used in this report.</p>
	<ul class="tags">
				<li><span class="field">return:</span> The url string</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			get_search_uri
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodget_tables" id="get_tables"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_tables</span> (line <span class="line-number">205</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">returns the list of table names, not the aliases</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_tables
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodget_table_by_alias" id="get_table_by_alias"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_table_by_alias</span> (line <span class="line-number">216</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">gets the concrete name of a table for the given alias</p>
	<ul class="tags">
				<li><span class="field">return:</span> The real table name</li>
				<li><span class="field">throws:</span> Exception if the alias doesn't exist</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			get_table_by_alias
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$alias</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$alias</span><span class="var-description">: The alias name to fetch the table for</span>			</li>
				</ul>
		
			
	</div>
<a name="methodget_table_fields" id="get_table_fields"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_table_fields</span> (line <span class="line-number">279</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">select the field names for the report tables from the database.</p>
	<ul class="tags">
				<li><span class="field">return:</span> the list of columns defined in the database tables.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_table_fields
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$table_name</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$table_name</span><span class="var-description">: optional table name.  If none is provided,  all tables defined in the report will be queried.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgroup" id="group"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">group</span> (line <span class="line-number">403</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">set the GROUP BY expression</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			group
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the form field as a column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the form variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: the group by expression</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgt" id="gt"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">gt</span> (line <span class="line-number">621</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">greater than: see documentation for ge()</p>
	<ul class="tags">
				<li><span class="field">return:</span> condition to pass to next filter</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			gt
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The field value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodhaving" id="having"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">having</span> (line <span class="line-number">443</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">set the HAVING clause</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			having
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$key</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the form field as a column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the form variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: the havin expression</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$key</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$field</span>			</li>
				</ul>
		
			
	</div>
<a name="methodjoin" id="join"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">join</span> (line <span class="line-number">373</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">add a table to the JOIN clause</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			join
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$table</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$table</span><span class="var-description">: The table to join; the format is array(table_name, alias)</span>			</li>
				</ul>
		
			
	</div>
<a name="methodle" id="le"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">le</span> (line <span class="line-number">610</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">less than or equal to: see documentation for ge()</p>
	<ul class="tags">
				<li><span class="field">return:</span> condition to pass to next filter</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			le
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The field value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodlike" id="like"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">like</span> (line <span class="line-number">654</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">like: see documentation for ge()</p>
	<ul class="tags">
				<li><span class="field">return:</span> condition to pass to next filter</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			like
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The field value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodlimit" id="limit"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">limit</span> (line <span class="line-number">430</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">set the LIMIT clause</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			limit
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$key</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the form field as a column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the form variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: the limit expression</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$key</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$field</span>			</li>
				</ul>
		
			
	</div>
<a name="methodlt" id="lt"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">lt</span> (line <span class="line-number">632</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">less than: see documentation for ge()</p>
	<ul class="tags">
				<li><span class="field">return:</span> condition to pass to next filter</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			lt
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The field value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodne" id="ne"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">ne</span> (line <span class="line-number">643</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">not equals: see documentation for ge()</p>
	<ul class="tags">
				<li><span class="field">return:</span> condition to pass to next filter</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			ne
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The column name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The field value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodorder" id="order"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">order</span> (line <span class="line-number">417</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">set the ORDER BY clause</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			order
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$key</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the form field as a column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the form variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: the order by expression</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$key</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$field</span>			</li>
				</ul>
		
			
	</div>
<a name="methodpivot" id="pivot"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">pivot</span> (line <span class="line-number">493</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">preform a pivot on a column.  Get the unique list of values</p>
<p class="description"><p>and return  them as a conditional aggregate expression to be added to the  select clause.  Right now only one aggregate type is supported: SUM  Also a little black magic is used to get the column name from the synthetic  column name needed here.  The column in the form and config should be called:  pivot-{$column_name} and it's value should be the column to return when the expression is true.</p><p>For example, if you have a hostname column with a count of signups, and you want to  pivot on the hostname and return the aggregate signups for each host as its own column,  then the form field should look like:</p><p>&lt;input type=&quot;checkbox&quot; name=&quot;dimension-pivot-hostname&quot; value=&quot;signups&quot; /&gt;  Count signups per-host</p><p>The report object config would look like:</p><p>'fields' =&gt; array(       'dimension' =&gt; array(           'pivot-hostname'    =&gt; 'pivot|select',       )  )</p><p>Then remember to set the unique list of value for this pivot operation:</p><p>$report = new MySQLTableReport( ... );  $hosts = $report-&gt;get_distinct_values('dimension','hostname');  $report-&gt;set_pivot_values('dimension-pivot-hostname', $hosts);</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport|string</span>
		<span class="method-name">
			pivot
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: The name of the pivot column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: The field variable name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The column to return in the IF($col_name}='value' ... ) expression</span>			</li>
				</ul>
		
			
	</div>
<a name="methodprocess_form_data" id="process_form_data"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">process_form_data</span> (line <span class="line-number">705</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Read all form data and process values. This will be called automatically  by query() and execute() methods.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			process_form_data
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">query</span> (line <span class="line-number">790</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">generate the SQL query and return it as a string.</p>
	<ul class="tags">
				<li><span class="field">return:</span> the SQL query build by this report object</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			query
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodraw_where" id="raw_where"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">raw_where</span> (line <span class="line-number">455</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">raw_where is an unprocessed string that is added to the WHERE clause</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			raw_where
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$expression</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span><span class="var-description">: ignored</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$field</span><span class="var-description">: ignored</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$expression</span><span class="var-description">: The raw WHERE expression</span>			</li>
				</ul>
		
			
	</div>
<a name="methodselect" id="select"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">select</span> (line <span class="line-number">351</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">add a column to the select field list</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			select
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$alias</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$aggregate</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$field</span><span class="var-description">: the field name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$alias</span><span class="var-description">: the field alias</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$aggregate</span><span class="var-description">: how to optionally aggregate values in this column</span>			</li>
				</ul>
		
			
	</div>
<a name="methodset_pivot_values" id="set_pivot_values"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">set_pivot_values</span> (line <span class="line-number">170</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">pivot operations require some setup -- this defines the list of values to turn into  additional columns when we ask the report to pivot a column.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			set_pivot_values
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$col_name</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$values</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$col_name</span><span class="var-description">: the name of the column to pivot</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$values</span><span class="var-description">: the list of values</span>			</li>
				</ul>
		
			
	</div>
<a name="methodwhere" id="where"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">where</span> (line <span class="line-number">387</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">add a condition to the WHERE clause.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">\MySQLTableReport</span>
		<span class="method-name">
			where
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$var_name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$op</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span><span class="var-description">: the full column name including table alias</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$var_name</span><span class="var-description">: the name of the form variable for this column</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$value</span><span class="var-description">: the form value</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$op</span><span class="var-description">: the conditional operator to use; default =</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 12 Mar 2012 11:59:41 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.4</a>
	</p>
	</div></body>
</html>